<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property int $appid 
 * @property string $appkey 
 * @property int $expiration_time 
 */
class Account extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'account';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'appid' => 'integer', 'expiration_time' => 'integer'];

    /**
     * @param $appid
     * @return bool
     */
    public static function checkAppid($appid){
        $info = self::select('id')->where(['appid'=>$appid])
            ->first();
        if (!$info) {
            return false;
        }
        return true;
    }
}